﻿using System;
using Fadd.Messaging;

namespace Fadd.IO.Consoles
{
    /// <summary>
    /// Data read from console standard out.
    /// </summary>
    [Serializable]
	public class ConsoleOutput : IMessage
	{
        /// <summary>
        /// Initializes a new instance of the <see cref="ConsoleOutput"/> class.
        /// </summary>
        /// <param name="color">The color.</param>
        /// <param name="text">The text.</param>
        public ConsoleOutput(ConsoleColor color, string text )
        {
            Color = color;
            Text = text;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ConsoleOutput"/> class.
        /// </summary>
        /// <param name="text">The text.</param>
        public ConsoleOutput(string text)
        {
            Text = text;
        }

		/// <summary>
		/// Gets or sets console color.
		/// </summary>
		public ConsoleColor Color { get; set; }

		/// <summary>
		/// Gets or sets output text.
		/// </summary>
		public string Text { get; set; }



        public static ConsoleOutput Error(string message)
        {
            return new ConsoleOutput(ConsoleColor.Red, message);
        }
	}
}
